﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Entities;
using Business;
namespace Presentation
{
    public partial class frmTraCuuKhachHang : DevComponents.DotNetBar.Office2007Form
    {
        public frmTraCuuKhachHang()
        {
            InitializeComponent();
            dgvKhachHang.AutoGenerateColumns = false;
        }

        private void frmTraCuuKhachHang_Load(object sender, EventArgs e)
        {

        }

        private void btnTraCuu_Click(object sender, EventArgs e)
        {
            string hoTen, diaChi, dienThoai, email;
            hoTen = txtHoTen.Text;
            diaChi = txtDiaChi.Text;
            dienThoai = txtDienThoai.Text;
            email = txtEmail.Text;
            List<KhachHangDTO> listKhachHang = KhachHangService.Search(hoTen, diaChi, dienThoai, email);
            dgvKhachHang.DataSource = listKhachHang;
            for (int i = 0; i < dgvKhachHang.Rows.Count; i++)
            {
                dgvKhachHang["STT", i].Value = i + 1;
            }
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
